home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / U.S. System⁄HyperCard / HyperCard—US 1.2.5 / HyperCard Ideas-US 1.2.5 / Idea Stacks / Stack Ideas / background_42187.txt < prev    next >
Encoding:
Text File  |  1988-11-07  |  7.8 KB  |  350 lines

  1. -- background: 42187 from stack: in
  2. -- bmap block id: 48382
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on extend
  8.   answer "Do you want three more months of cards?" with "Cancel" or "OK"
  9.   if it is "Cancel" then exit extend
  10.   go to last card of this background
  11.   put getStartDate() into start      --what date to begin on
  12.   if start is "Cancel" then exit extend
  13.   put 60*60*24 into OneDay      --seconds in a day
  14.   put start into it        --a copy
  15.   convert it to long date
  16.   global calcMonth
  17.   put word 1 of item 2 of it into calcMonth
  18.   set name of this bkgnd to calcMonth
  19.   repeat with cnt = 1 to (365 div 4)   --three months
  20.     put start into it        --a copy
  21.     convert it to long date
  22.     put item 1 of it into field "Day of Week"
  23.     put item 2 of it into field "Date"
  24.     put item 3 of it into field "Year"
  25.     add OneDay to start
  26.     doMenu New Card
  27.     upDateBkgnd start  --make a new background if new month
  28.   end repeat
  29.   doMenu "Delete Card"
  30. end extend
  31.  
  32. on upDateBkgnd start
  33.   global calcMonth
  34.   put start into it        --a copy
  35.   convert it to long date
  36.   if word 1 of item 2 of it <> calcMonth then   --if new month
  37.     --create a new background.
  38.     put word 1 of item 2 of it into calcMonth
  39.     doMenu "Cut Card"    --new bkgnd is a copy with only name changed
  40.     go previous card
  41.     put the long name of this card into goodStack
  42.     set lockScreen to true
  43.     go to stack "home"
  44.     --must go to another stack to avoid changing the original bkgnd
  45.     doMenu "Paste Card"
  46.     set name of this background to word 1 of item 2 of it
  47.     doMenu "Cut Card"
  48.     go goodStack
  49.     set lockScreen to false
  50.     doMenu "Paste Card"
  51.     set name of this bkgnd to calcMonth
  52.   end if
  53. end upDateBkgnd
  54.  
  55. function getStartDate
  56. -- end of stack or today, whichever is newer
  57. get field "Date"
  58. if it is empty then put the short date into it
  59. convert it to seconds    --so we can compare
  60. put the short date into today
  61. convert today to seconds
  62. if today < 2587766400 then
  63.   answer "Set the Control Panel to today's date" with "OK"
  64.   return "Cancel"
  65. end if
  66. if it >= today then return it   --calendar already beyond today
  67. convert it to short date
  68. answer "Start from which date?" with it or the short date or "Cancel"
  69. if it is "Cancel" then return it
  70. convert it to seconds
  71. return it
  72. end getStartDate
  73.  
  74. on openBackground
  75.   push recent card
  76. end openBackground
  77.  
  78.  
  79. -- part 7 (button)
  80. -- low flags: 00
  81. -- high flags: 0000
  82. -- rect: left=321 top=283 right=311 bottom=350
  83. -- title width / last selected line: 0
  84. -- icon id / first selected line: 0 / 0
  85. -- text alignment: 1
  86. -- font id: 0
  87. -- text size: 12
  88. -- style flags: 0
  89. -- line height: 16
  90. -- part name: Do
  91. ----- HyperTalk script -----
  92. on mouseUp
  93.   go card "First Do" of "Datebook"
  94. end mouseUp
  95.  
  96.  
  97.  
  98. -- part 8 (field)
  99. -- low flags: 00
  100. -- high flags: 4000
  101. -- rect: left=59 top=119 right=290 bottom=489
  102. -- title width / last selected line: 0
  103. -- icon id / first selected line: 0 / 0
  104. -- text alignment: 0
  105. -- font id: 3
  106. -- text size: 10
  107. -- style flags: 0
  108. -- line height: 16
  109. -- part name: c
  110.  
  111.  
  112. -- part 9 (button)
  113. -- low flags: 00
  114. -- high flags: 0000
  115. -- rect: left=26 top=281 right=315 bottom=64
  116. -- title width / last selected line: 0
  117. -- icon id / first selected line: 1011 / 1011
  118. -- text alignment: 1
  119. -- font id: 0
  120. -- text size: 12
  121. -- style flags: 0
  122. -- line height: 16
  123. -- part name: Home
  124. ----- HyperTalk script -----
  125. on mouseUp
  126.   visual effect iris close
  127.   go "Home"
  128. end mouseUp
  129.  
  130.  
  131.  
  132. -- part 10 (button)
  133. -- low flags: 00
  134. -- high flags: 0000
  135. -- rect: left=420 top=281 right=312 bottom=455
  136. -- title width / last selected line: 0
  137. -- icon id / first selected line: 30696 / 30696
  138. -- text alignment: 1
  139. -- font id: 0
  140. -- text size: 12
  141. -- style flags: 0
  142. -- line height: 16
  143. -- part name: Phone
  144. ----- HyperTalk script -----
  145. on mouseUp
  146.   get the selection
  147.   if it is empty then get the message
  148.   if it is empty then ask "Dial what number?"
  149.   if it is not empty then
  150.     push this card
  151.     visual effect zoom open
  152.     go to stack "Phone"
  153.     dial it
  154.     pop card
  155.   end if
  156. end mouseUp
  157.  
  158.  
  159.  
  160. -- part 11 (button)
  161. -- low flags: 00
  162. -- high flags: 0000
  163. -- rect: left=458 top=280 right=311 bottom=491
  164. -- title width / last selected line: 0
  165. -- icon id / first selected line: 0 / 0
  166. -- text alignment: 1
  167. -- font id: 0
  168. -- text size: 12
  169. -- style flags: 0
  170. -- line height: 16
  171. -- part name: Address
  172. ----- HyperTalk script -----
  173. on mouseUp
  174.   get the selection
  175.   visual effect zoom open
  176.   go to "Address"
  177.   if it is not empty then find it
  178. end mouseUp
  179.  
  180.  
  181.  
  182. -- part 12 (button)
  183. -- low flags: 00
  184. -- high flags: 0000
  185. -- rect: left=355 top=285 right=310 bottom=383
  186. -- title width / last selected line: 0
  187. -- icon id / first selected line: 0 / 0
  188. -- text alignment: 1
  189. -- font id: 0
  190. -- text size: 12
  191. -- style flags: 0
  192. -- line height: 16
  193. -- part name: Datebook Answer
  194. ----- HyperTalk script -----
  195. on mouseUp
  196.   answer "This is a Daily Calendar" with OK
  197. end mouseUp
  198.  
  199.  
  200.  
  201.  
  202. -- part 13 (button)
  203. -- low flags: 00
  204. -- high flags: 0000
  205. -- rect: left=389 top=286 right=310 bottom=416
  206. -- title width / last selected line: 0
  207. -- icon id / first selected line: 0 / 0
  208. -- text alignment: 1
  209. -- font id: 0
  210. -- text size: 12
  211. -- style flags: 0
  212. -- line height: 16
  213. -- part name: Calendar
  214. ----- HyperTalk script -----
  215. on mouseUp
  216.   get the seconds
  217.   convert it to dateItems
  218.   put ((item 1 of it) - 1987) *2 into whichSix
  219.   if item 2 of it > 6 then add 1 to whichSix
  220.   visual effect zoom open
  221.   if whichSix < 1 then go card 1 of stack "Datebook"
  222.   else if whichSix > 5 then go card 5 of stack "Datebook"
  223.   else
  224.     go to card whichSix of stack "Datebook"
  225.     send "bracketWeek" && the seconds to this card
  226.   end if
  227. end mouseUp
  228.  
  229.  
  230.  
  231. -- part 15 (button)
  232. -- low flags: 00
  233. -- high flags: 0000
  234. -- rect: left=229 top=309 right=334 bottom=256
  235. -- title width / last selected line: 0
  236. -- icon id / first selected line: 1014 / 1014
  237. -- text alignment: 1
  238. -- font id: 0
  239. -- text size: 12
  240. -- style flags: 0
  241. -- line height: 16
  242. -- part name: Prev
  243. ----- HyperTalk script -----
  244. on mouseUp
  245.   visual effect wipe right
  246.   go to previous card
  247. end mouseUp
  248.  
  249.  
  250.  
  251. -- part 16 (button)
  252. -- low flags: 00
  253. -- high flags: 0000
  254. -- rect: left=257 top=308 right=335 bottom=285
  255. -- title width / last selected line: 0
  256. -- icon id / first selected line: 1013 / 1013
  257. -- text alignment: 1
  258. -- font id: 0
  259. -- text size: 12
  260. -- style flags: 0
  261. -- line height: 16
  262. -- part name: Next
  263. ----- HyperTalk script -----
  264. on mouseUp
  265.   visual effect wipe left
  266.   go to next card
  267. end mouseUp
  268.  
  269.  
  270.  
  271. -- part 17 (button)
  272. -- low flags: 00
  273. -- high flags: 0000
  274. -- rect: left=464 top=311 right=336 bottom=495
  275. -- title width / last selected line: 0
  276. -- icon id / first selected line: 1012 / 1012
  277. -- text alignment: 1
  278. -- font id: 0
  279. -- text size: 12
  280. -- style flags: 0
  281. -- line height: 16
  282. -- part name: Return
  283. ----- HyperTalk script -----
  284. on mouseUp
  285.   visual effect iris close
  286.   pop card
  287. end mouseUp
  288.  
  289.  
  290.  
  291. -- part 18 (field)
  292. -- low flags: 00
  293. -- high flags: 0000
  294. -- rect: left=22 top=61 right=84 bottom=193
  295. -- title width / last selected line: 0
  296. -- icon id / first selected line: 0 / 0
  297. -- text alignment: 0
  298. -- font id: 2
  299. -- text size: 18
  300. -- style flags: 0
  301. -- line height: 24
  302. -- part name: Day of Week
  303.  
  304.  
  305. -- part 19 (field)
  306. -- low flags: 00
  307. -- high flags: 0000
  308. -- rect: left=11 top=81 right=115 bottom=205
  309. -- title width / last selected line: 0
  310. -- icon id / first selected line: 0 / 0
  311. -- text alignment: 0
  312. -- font id: 2
  313. -- text size: 24
  314. -- style flags: 0
  315. -- line height: 32
  316. -- part name: Date
  317.  
  318.  
  319. -- part 20 (field)
  320. -- low flags: 00
  321. -- high flags: 0000
  322. -- rect: left=305 top=25 right=50 bottom=380
  323. -- title width / last selected line: 0
  324. -- icon id / first selected line: 0 / 0
  325. -- text alignment: 0
  326. -- font id: 2
  327. -- text size: 18
  328. -- style flags: 0
  329. -- line height: 24
  330. -- part name: Year
  331.  
  332.  
  333. -- part 21 (button)
  334. -- low flags: 00
  335. -- high flags: 8003
  336. -- rect: left=26 top=314 right=329 bottom=72
  337. -- title width / last selected line: 0
  338. -- icon id / first selected line: 0 / 0
  339. -- text alignment: 1
  340. -- font id: 3
  341. -- text size: 9
  342. -- style flags: 0
  343. -- line height: 12
  344. -- part name: Extend
  345. ----- HyperTalk script -----
  346. on mouseUp
  347.   extend
  348. end mouseUp
  349.  
  350.